{% extends "performance/navigation.html" %}
<!--main content start-->
{% block body %}
    <section id="main-content">
        <section class="wrapper">
            <h3>
                <b id="angle_android"><i class="fa fa-angle-right"></i></b> 国内Android
            </h3>
            <div class="row mt" id="home_android">
                <div style="margin-bottom: 2%; margin-left: 2%">
                    <form method='get'>
                        {% for labels in sql_alabel %}
                            {% if label_android == labels %}
                                <input class="btn-warning" name="label_android" type="submit" value="{{ labels }}">
                            {% else %}
                                <input class="btn-info" name="label_android" type="submit" value="{{ labels }}">
                            {% endif %}
                        {% endfor %}
                    </form>
                </div>
                <div class="col-sm-12">
                    <div class="content-panel">
                        <h4><i class="fa fa-angle-right"></i> 曲线图</h4>
                        <div class="panel-body">
                            <div id="hero-graph" class="graph"></div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-12" style="margin-top: 2%">
                    <div class="content-panel">
                        <table id="table1" class="table table-striped table-advance table-hover">
                            <h4><i class="fa fa-angle-right"></i> <i class="fa fa-dedent"></i> Detail</h4>
                            <hr>
                            <thead>
                            <tr>
                                <th style="text-align: center"><i class="fa fa-tags"></i> Version</th>
                                <th style="text-align: center"><i class="fa fa-adjust"></i> Average Value</th>
                                <th style="text-align: center"><i class="fa fa-fire"></i> Peak Value</th>
                                <th style="text-align: center"><i class="fa fa-meh-o"></i> Model</th>
                                <th style="text-align: center"><i class="fa fa-circle-o-notch"></i> Result</th>
                                <th style="text-align: center"></th>
                            </tr>
                            </thead>
                            <tbody>
                            {% for list in data_list_android %}
                                <tr style="text-align: center;">
                                    <td><a href="">{{ list.versions }}</a></td>
                                    <td>{{ list.agvflowdown }}</td>
                                    <td>{{ list.maxflowdown }}</td>
                                    <td><span class="label label-info label-mini">{{ list.model }}</span></td>
                                    <td>
                                        {% if list.result == "pass" %}
                                            <button class="btn btn-success btn-xs">{{ list.result }}</button>
                                        {% else %}
                                            <button class="btn btn-danger btn-xs">{{ list.result }}</button>
                                        {% endif %}
                                    </td>
                                </tr>
                            {% endfor %}
                            </tbody>
                        </table>
                        <div style="text-align: center; margin-top: -20px; display: block" id="hasmore">
                            <i class="fa fa-angle-double-down"></i>
                        </div>
                    </div><!-- /content-panel -->
                </div>
                {#                {% endif %}#}
            </div>
            <!-- page end-->
        </section>
        <section class="wrapper" style="margin-top: -1%; margin-bottom: 2%">
            <h3>
                <i class="fa fa-angle-right"></i> 国内ios
            </h3>
            <div class="row mt">
                <div style="margin-bottom: 2%; margin-left: 2%">
                    <form method='get'>
                        {% for labels in sql_alabel %}
                            {% if label_ios == labels %}
                                <input class="btn-warning" name="label_ios" type="submit" value="{{ labels }}">
                            {% else %}
                                <input class="btn-info" name="label_ios" type="submit" value="{{ labels }}">
                            {% endif %}
                        {% endfor %}
                    </form>
                </div>
                <div class="col-sm-12">
                    <div class="content-panel">
                        <h4><i class="fa fa-angle-right"></i> 曲线图</h4>
                        <div class="panel-body">
                            <div id="hero-graph-ios" class="graph"></div>
                        </div>
                    </div>
                </div>
                {#                {% if data_ios != "" %}#}
                <div class="col-sm-12" style="margin-top: 2%">
                    <div class="content-panel">
                        <table id="table2" class="table table-striped table-advance table-hover">
                            <h4><i class="fa fa-angle-right"></i> <i class="fa fa-dedent"></i> Detail</h4>
                            <hr>
                            <thead>
                            <tr>
                                <th style="text-align: center"><i class="fa fa-tags"></i> Version</th>
                                <th style="text-align: center"><i class="fa fa-adjust"></i> Average Value</th>
                                <th style="text-align: center"><i class="fa fa-fire"></i> Peak Value</th>
                                <th style="text-align: center"><i class="fa fa-meh-o"></i> Model</th>
                                <th style="text-align: center"><i class="fa fa-circle-o-notch"></i> Result</th>
                                <th style="text-align: center"></th>
                            </tr>
                            </thead>
                            <tbody>
                            {% for list in data_list_ios %}
                                <tr style="text-align: center;">
                                    <td><a href="">{{ list.versions }}</a></td>
                                    <td>{{ list.agvflowdown }}</td>
                                    <td>{{ list.maxflowdown }}</td>
                                    <td><span class="label label-info label-mini">{{ list.model }}</span></td>
                                    <td>
                                        {% if list.result == "pass" %}
                                            <button class="btn btn-success btn-xs">{{ list.result }}</button>
                                        {% else %}
                                            <button class="btn btn-danger btn-xs">{{ list.result }}</button>
                                        {% endif %}
                                    </td>
                                </tr>
                            {% endfor %}
                            </tbody>
                        </table>
                        <div style="text-align: center; margin-top: -20px; display: block" id="hasmore_ios">
                            <i class="fa fa-angle-double-down"></i>
                        </div>
                    </div><!-- /content-panel -->
                </div>
                {#                {% endif %}#}
            </div>
            <!-- page end-->
        </section>
    </section><!-- /MAIN CONTENT -->

{% endblock %}
{% block javascript %}
    <script>
        $(document).ready(function () {
            var tables = document.getElementById("table1");
            var tables_ios = document.getElementById("table2");

            function hidden_tables() {
                if (tables.rows.length <= 3) {
                    document.getElementById("hasmore").style.display = "none";
                }
                for (i = 0; i < tables.rows.length; i++) {
                    if (i > 2) {
                        tables.rows[i].style.display = tables.rows[i].style.display == "none" ? "" : "none";
                    }
                }
            }

            function hidden_tables_ios() {
                if (tables_ios.rows.length <= 3) {
                    document.getElementById("hasmore_ios").style.display = "none";
                }
                for (i = 0; i < tables_ios.rows.length; i++) {
                    if (i > 2) {
                        tables_ios.rows[i].style.display = tables_ios.rows[i].style.display == "none" ? "" : "none";
                    }
                }
            }

            hidden_tables();
            hidden_tables_ios();
            $("#hasmore").click(function () {
                hidden_tables();
                document.getElementById("hasmore").style.display = "none";
            });
            $("#hasmore_ios").click(function () {
                hidden_tables_ios();
                document.getElementById("hasmore_ios").style.display = "none";
            });
            {#            $("#angle_android").click(function () {#}
            {#                document.getElementById("home_android").style.display = "none"#}
            {#            });#}
            $("#angle_android").click(function () {
                $("#home_android").toggle();
            })
        });
        var mydata = {
            licensed1: {{ licensed1 }},
            sorned1: {{ sorned1 }},
            version01: {{ version01 }},
            version02: {{ version02 }}
        };
        var mydata_ios = {
            licensed2: {{ licensed2 }},
            sorned2: {{ sorned2 }},
            version01: {{ version01_ios }},
            version02: {{ version02_ios }}
        };

    </script>
    <script src="../../qa/static/perform/js/morris-conf.js"></script>
    <script src="../../qa/static/js/plugins/morris/raphael.min.js"></script>
    <script src="../../qa/static/js/plugins/morris/morris.min.js"></script>
    <script src="../../qa/static/js/plugins/morris/morris-data.js"></script>
    <link rel="stylesheet" href="../../qa/static/css/plugins/morris.css">
{% endblock %}



